
var config = $.extend(true, {}, listApp, {
    data : {
        service : deviceStatusService,
        treeData:{},
        searchVm:{
            deviceName:'',
            deviceCode:'',
            protocolStype:'',
            netName:'',
            protocolName:'',
            virtual:'',
            spotIds:[],
            spotId:''

        },
        tableVm:{
            loading:false
        },
        treeStyle:{
            float:'left',
            width:'20%'
        },
        tableStyle:{
            float:'left',
            marginLeft:'20px',
            width:'78%'
        },
        spotList:[],
        requestPagePath:'requestStatusPageList'
    },
    methods : {
        init:function () {

        },
        getTreeSelectedVal:function (data) {
            this.treeData = data;
            this.search();
        },
        collapse:function (isCollapsed) {

            if(isCollapsed){
                this.treeStyle.width='3%';
                this.tableStyle.width='80%';
            }else{
                this.treeStyle.width='20%';
                this.tableStyle.width='78%';
            }
        },
        formatterStatus:function(row){
            return row.deviceRstatus===0 ? "超时" : "正常"
        },
        filterClass:function(row){
            if(row.columnIndex === 6){
                return row.row.deviceRstatus===0 ?"red":"green";
            }
        },

        formatterStype:function (row){
            return row.virtual==0 ? row.protocolStype: "虚拟设备"
        },
        getChildrenSpot:function (data) {
            this.searchVm.spotIds=[];
            for(var i=0;i<data.length;i++){
                this.searchVm.spotIds.push(data[i].id);
            }
            this.search();

        }


    }
});
var app = new Vue(config);